<template>
  <div class="wrap">
    <div class="top">
      <div class="pledgee-name">
        <span>撤回商标续展注册申请书</span>
      </div>

      <div class="pledgee-msg">
        <div class="top-left">
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人名称（中文）：</span>
              <el-input v-if="control" v-model="appNameCn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNameCn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model="appNameEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNameEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人地址（中文）：</span>
              <el-input v-if="control" v-model=" appAddCn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appAddCn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-right">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model=" appAddEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ appAddEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮政编码 ：</span>
              <el-input v-if="control" v-model="postCode" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{postCode}}</span>
            </div>
          </div>
          <div class="form-menu" v-if="contacts">
            <div class="form-menu-left">
              <span class="form-menu-text">联系人 ：</span>
              <el-input v-if="control" v-model="contacts" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{contacts}}</span>
            </div>
          </div>
          <div class="form-menu" v-if="email">
            <div class="form-menu-left">
              <span class="form-menu-text">邮箱 ：</span>
              <el-input v-if="control" v-model="email" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{email}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">电话 ：</span>
              <el-input v-if="control" v-model="phone" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{phone}}</span>
            </div>
          </div>
          <!-- <div class="form-menu">
                        <div class="form-menu-left">
                          <span class="form-menu-text">代理机构名称 ：</span>
                          <el-input v-if="control" v-model="ageName" placeholder="请输入内容"></el-input>
                          <span class="parallelism" v-else>{{ageName}}</span>
                        </div>
          </div>-->
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">商标注册号 ：</span>
              <el-input v-if="control" v-model="appNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNum}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">是否共有商标 ：</span>
              <span class="parallelism">
                <span v-show="sfz==1">否</span>
                <span v-show="sfz !=1">是</span>
              </span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">原续展申请号 ：</span>
              <el-input v-if="control" v-model="registNumOri" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{registNumOri}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">撤回理由 ：</span>
              <el-input
                v-if="control"
                type="textarea"
                show-word-limit
                maxlength="100"
                :rows="1"
                placeholder="请输入内容"
                v-model=" reasonsWithdrawal"
              ></el-input>
              <span class="parallelism" v-else>{{reasonsWithdrawal}}</span>
            </div>
          </div>

          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">营业执照 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <div>
                <imgshow>
                  <img :src="this.mconfig.host+busimg" alt />
                </imgshow>
                </div>
              </span>
            </div>
          </div>
          <div class="form-menu" v-if="this.idcardimg !== '' ">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">身份证正反照 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <div>
                <imgshow>
                  <img :src="this.mconfig.host+idcardimg" alt />
                </imgshow>
                </div>
              </span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">网上确认书 ：</span>
              <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <div>
                <imgshow>
                  <img :src="this.mconfig.host+qrfile" alt />
                </imgshow>
                </div>
              </span>
            </div>
          </div>

          <div class="form-menu" v-if="otherfile.length != 0">
            <div class="form-menu-left">
              <span class="form-menu-text" style="height:100%">其他附件 ：</span>
              <el-input v-if="control" v-model="otherfile" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>
                <div>
                <imgshow v-for="(item,index) in otherfile" :key="index">
                  <img :src="mconfig.host+item" alt />
                </imgshow>
                </div>
              </span>
            </div>
          </div>

         

          <!-- <div id="sfz1" class="form-menu" style="margin-top:20px;">
                        <div class="form-menu-left">
                            <span class="form-menu-text" style="height:510px;">身份证正反照 ：</span>
                             <el-input v-if="control" v-model="numpic" placeholder="请输入内容"></el-input>
                            <span class="parallelism" v-else>
                                <div class="yy1box">
                                    <img :src="this.mconfig.host+idcardimg" alt="">
                                </div>
                                <div class="yy1box">
                                     <img :src="this.mconfig.host+idcardimg" alt="">
                                </div>
                            </span>
                        </div>
          </div>-->
        </div>
      </div>
    </div>

    <div class="follower">
      <div class="follower-title">
        <div>
          <div class="text-align: right;">撤回商标续展注册申请书</div>
          <div class="text-align: center;" style="margin-left:85px">（附页）</div>
        </div>
        <span class="follower-title-text" style="margin-left:50px">其他共同申请人名称列表</span>
      </div>
      <proAppend class="part" :callback="proAppendJson"></proAppend>
      <!-- <div class="follower-matter">
        <div class="follower-matter-frame" v-for="(mat,ter) in proAppendJson" :key="ter">
          <div>
            <div class="follower-matter-text">
              <span style="width:320px;display: inline-block;text-align: right;">{{ter+1}}. 名称（中文）：</span>
              <span style="margin-left: 10px;">{{mat.partNameCh}}</span>
            </div>
            <div class="follower-matter-text">
              <span style="width:320px;display: inline-block;text-align: right;">名称（英文）：</span>
              <span style="margin-left: 10px;">{{mat.partNameEn}}</span>
            </div>
            <div class="follower-matter-text">
              <span style="width:320px;display: inline-block;text-align: right;">地址（中文）：</span>
              <span style="margin-left: 10px;">{{mat.partAddrCh}}</span>
            </div>
            <div class="follower-matter-text">
              <span style="width:320px;display: inline-block;text-align: right;">地址（英文）：</span>
              <span style="margin-left: 10px;">{{mat.partAddrEn}}</span>
            </div>
          </div>
          <div class="seal">（戳章/签字）</div>
        </div>
      </div> -->
    </div>

    <!-- <div class="botton" style="width:100%;text-align:center;padding:15px 0;">
               <a class="buttona" href="javascript:;" @click="submit()">提交</a>
        </div>
        <div class="amend-btn">
             <a class="buttona" href="javascript:;" @click="notarizeAmend">确认修改</a>
    </div>-->
  </div>
</template>

<script>
import imgshow from "../common/imgshow"
import proAppend from "../common/proAppend"
export default {
    components:{
        imgshow,
        proAppend
    },
  data() {
    return {
      ageName: "", //  代理机构名称
      appAddCn: "", //   申请人地址（中文）
      appAddEn: "", //   申请人地址（英文）
      appNameCn: "", //   申请人名义（中文）
      appNameEn: "", //   申请人名义（英文）
      appNum: "", //   商标注册号
      branchNetworkId: "", //   网点编号
      cancelled: "", //   注销商品/服务项目
      contacts: "", //   联系人
      email:"", //邮箱
      id: "",
      isComm: "", //   是否共有商标
      phone: "", //   电话
      postCode: "", //   邮政编码
      proAppendJson: [], //   共享人json
      reasonsWithdrawal: "", //   撤回理由
      registNumOri: "", //   原续展申请号
      subStatus: "", //   状态
      userId: "", //   用户ID
      busimg: "", // 营业执照

      qrfile:"", //网上确认书
      otherfile:[],//其他附件
      
      idcardimg: "", //身份证正面照
      control: false, //   控制标签的显示
      options: [
        { value: 0, label: "企业" },
        { value: 1, label: "个人" },
      ],
      optionss: [
        { value: 1, label: "保存" },
        { value: 2, label: "通过" },
        { value: 3, label: "未通过" },
        { value: 4, label: "未审核" },
      ],
      dialogVisible: false,
      disabledd: false,
      isComms: "", //   是否共有商标的文本部分(页面展示)
      subStatuss: "", //   状态(页面展示)
      lastName: "",
      sfz: "",
      idcardimg: "",
    };
  },
  methods: {
    genre() {
      //console.log(this.appliType)
    },
    notarizeAmend() {
      if (this.control) {
        this.control = false;
        //console.log(this.control)
      } else {
        this.control = true;
        //console.log(this.control)
      }
    },
    handleExceed(files, fileList) {
      //   图片地址
      this.disabledd = true;
      let a = "http://api_devs.wanxikeji.cn/" + files.data;
      this.imgPath.push(a);
      // //console.log(this.imgPath)
    },
    handlePictureCardPreview(file) {
      //  上传图片的放大显示
      this.imgPath = file.url;
      this.dialogVisible = true;
      //  //console.log('www',file)
    },
    handleRemove(file) {
      //  上传图片的删除
      //console.log(file);
      this.disabledd = false;
      this.$refs.upload.clearFiles();
    },
    add(val) {
      this.$http
        .get("/trademark/proWotlrf/findByIdDetl", {
          params: {
            id: val,
          },
        })
        .then((res) => {
          console.log(res);
          this.appNameCn = res.data.data.data.appName; //   申请人名称（中文）
          this.appNameEn = res.data.data.data.appNameEn; //   申请人名称（英文）
          this.appAddCn = res.data.data.data.busAddress; //   申请人地址（中文）
          this.appAddEn = res.data.data.data.appAddEn; //   申请人地址（英文）
          this.postCode = res.data.data.data.postCode; //  邮政编码
          this.contacts = res.data.data.data.contacts; //  联系人
          this.email = res.data.data.data.email; //邮箱
          this.phone = res.data.data.data.phone; //  电话
          this.ageName = res.data.data.data.deptName; //  代理机构
          this.appNum = res.data.data.data.registNum; //  商标注册号
          this.isComm = String(res.data.data.data.isShare); //  是否共有商标
          this.reasonsWithdrawal = res.data.data.data.reasonsWithdrawal; //  撤回理由
          this.busimg = res.data.data.data.busimg; //营业执照
          this.idcardimg = res.data.data.data.idcardimg; //身份证正照
          this.qrfile = res.data.data.data.qrfile;  //网上确认书
          this.registNumOri = res.data.data.data.registNumOri; //  原续展申请号
          console.log(this.registNumOri);
          this.proAppendJson = res.data.data.append; //   共有人
          this.otherfile = JSON.parse(res.data.data.data.otherfile);
         
          // if(res.data.data.append2[0].partNameCh){
          //       this.lastName = res.data.data.append2[0].partNameCh;
          // }
          this.sfz = res.data.data.data.appliType;
          this.idcardimg = res.data.data.data.idcardimg;
          this.xians();
        });
    },
    xians() {
      var follower = document.querySelector(".follower");
      var sfz1 = document.querySelector("#sfz1");
      if (this.lastName) {
        follower.style.display = "block";
      } else {
        follower.style.display = "none";
      }
    //   if (this.sfz1) {
    //     sfz1.style.display = "block";
    //   } else {
    //     sfz1.style.display = "none";
    //   }
    },
  },
  watch: {
    control(val) {
      if (val) {
      } else {
        if (this.isComm == 1) {
          this.isComms = "是";
        } else if (this.isComm) {
          this.isComms = "否";
        }

        if (this.subStatus == 1) {
          this.subStatuss = "保存";
        } else if (this.subStatus == 2) {
          this.subStatuss = "通过";
        } else if (this.subStatus == 3) {
          this.subStatuss = "未通过";
        } else if (this.subStatus == 4) {
          this.subStatuss = "未审核";
        }
      }
      //console.log(this.applicantType,this.isComm,this.subStatus)
    },
  },

  mounted() {
    let aa = this.$route.query.id;
    this.add(aa);
    // console.log(this.busimg)
    this.xians();
  },
};
</script>


<style scoped>
body,
div,
a,
p,
span,
ul,
li {
  padding: 0;
  margin: 0;
}
.form16{
  margin-left: 213px;
}
div {
  box-sizing: border-box;
}
img {
  max-width: 100%;
  max-height: 100%;
}
a {
  text-decoration: none;
}
.wrap {
  padding: 20px 20px;
  position: relative;
}
.amend-btn {
  position: absolute;
  top: 8%;
  right: 10%;
}
.buttona {
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  background: rgba(0, 0, 255, 0.5);
}
.buttona:hover {
  background: rgba(0, 0, 255, 0.8);
}
.top {
  /* 质权人信息部分  */
  min-width: 1200px;
  /* margin: 0 auto; */
  padding: 10px 5px;
  /* border: 1px solid blue; */
}
.pledgee-name {
  font-size: 25px; /* 质权人信息部分整体框架  */
  width: 100%;
  font-size: 25px;
  padding-left: 330px;
}
.dashed-text {
  /* 质权人信息部分的标题  */
  font-size: 17px;
  font-weight: bold;
  color: rgb(100, 100, 100);
}
.dashed {
  /* 质权人信息部分的内容  */
  width: 50%;
  margin-left: 10px;
  border-top: 1px dashed rgb(204, 204, 204);
}
.pledgee-msg {
  margin-top: 25px; /* 内容部分的整体框架  */
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-left {
  /* 内容的左边部分  */
  width: 100%;
  /* border: 1px solid red; */
}
.form-menu {
  /*  每行内容的显示  */
  display: flex;
  flex-direction: row;
  padding: 5px 80px 5px 50px;
  padding: 8px 0;
}
.form-menu-left {
  width: 40%;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-left: 280px;
  text-align: right;
}
.form-menu-right {
  width: 40%;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: right;
  margin-left: 280px;
}
.form-menu-text {
  /*  每行内容文本的css样式的显示  */
  width: 210px;
  font-size: 13px;
  /* text-align: right; */
  margin-right: 25px;
  /* padding-top: 10px; */
  color: rgb(140, 140, 140);
  /* border: 1px solid red; */
}
.parallelism {
  width: 100%;
  /* border: 1px solid green; */
  /* padding: 10.2px 0; */
  /* border: 1px solid blue; */
  text-align: left;
}
.el-input /deep/ .el-input__inner {
  color: #000;
  height: 38px;
}

.el-select {
  width: 700px;
}
.el-select-dropdown__item {
  padding-left: 20px;
}
/* 新版本样式 */
.stamp {
  width: 30%;
  height: 250px;
  font-size: 15px;
  text-align: center;
}
.agent {
  width: 100%;
  text-align: right;
  margin-right: 25%;
}
.follower {
  padding: 50px 0 0 0;
}
.follower-title {
  margin-left: 340px;
  /* font-weight: bold; */
  font-size: 25px;
}
.follower-title-text {
  font-size: 16px;
  font-weight: normal;
  display: inline-block;
  padding: 20px 0 15px 0;
}
.follower-matter-frame {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 20%;
  margin-bottom: 20px;
}
.seal {
  color: rgb(104, 104, 104);
}
.follower-matter-text {
  width: 100%;
  font-size: 15px;
  text-align: left;
  padding: 10px 0px;
  margin-left: 200px;
}
.yybox {
  width: 500px;
  height: 600px;
  margin-right: 43px;
}
.yy1box {
  width: 300px;
  height: 250px;
}
.yybox img {
  width: 100%;
  height: 100%;
}
.yybox1 img {
  width: 100%;
  height: 100%;
}
.bobo {
  margin-top: 0px;
}
.part{
  margin-left: 230px;
}
</style>